package org.lh.ibernate.config;

import java.sql.Connection;
import java.sql.SQLException;

//链接对象
public class DbPoolConn {
    public Connection connection;
    public boolean isBusy=false;


    public Connection getConnection() {
        return connection;
    }

    public void setConnection(Connection connection) {
        this.connection = connection;
    }

    public boolean isBusy() {
        return isBusy;
    }

    public void setBusy(boolean busy) {
        isBusy = busy;
    }

    //创建一个连接池连接（将其存储在连接池里面）
    public DbPoolConn(Connection connection,boolean isBusy){
        this.connection=connection;
        this.isBusy=isBusy;
    }


    //相当于释放掉当前的连接对象
    public void freeConnection() throws SQLException {
        this.isBusy=false;
    }
}
